package com.ktjiaoyu.config;

import com.ktjiaoyu.web.filter.AuthorizationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

//    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean filterRegistrationBean=
                new FilterRegistrationBean();

        filterRegistrationBean.setFilter(new AuthorizationFilter());
        filterRegistrationBean.addUrlPatterns("/main");
        filterRegistrationBean.setOrder(1);
        filterRegistrationBean.setName("AuthorizationFilter");

        return filterRegistrationBean;
    }
}
